import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/components/Layout'
import Home from '@/components/Home'
import Business from '@/components/Business'
import Mine from '@/components/Mine'
import Order from '@/components/Order'
import OrderDetailBuyer from '@/components/OrderDetailBuyer'
import OrderDetailSeller from '@/components/OrderDetailSeller'
import PublishSell from '@/components/PublishSell'
import PublishBuy from '@/components/PublishBuy'
import SecurityCenter from '@/components/SecurityCenter'
import ExchangeGst from '@/components/ExchangeGst'
import ExchangeRecord from '@/components/ExchangeRecord'
import ExchangeCandy from '@/components/ExchangeCandy'
import ExchangeCandyRecord from '@/components/ExchangeCandyRecord'
import PublishBusiness from '@/components/PublishBusiness'
import Feedback from '@/components/Feedback'
import FeedbackHistory from '@/components/FeedbackHistory'
import FeedbackDetail from '@/components/FeedbackDetail'
import ProblemFeedback from '@/components/ProblemFeedback'
import Login from '@/components/Login'
import BusinessDetail from '@/components/BusinessDetail'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'layout',
      redirect: "/mine",
      component: Layout,
      children: [
        {
          path: '/home',
          component: Home
        },
        {
          path: '/business',
          component: Business
        },
        {
          path: '/order',
          component: Order
        },
        {
          path: '/mine',
          component: Mine,
          children: [
            {
              path: '/exchange/gst',
              component: ExchangeGst,
              children: [
                {
                  path: '/exchange/record',
                  component: ExchangeRecord
                }
              ]
            },
            {
              path: '/exchange/candy',
              component: ExchangeCandy,
              children: [
                {
                  path: '/exchange/candy/record',
                  component: ExchangeCandyRecord
                }
              ]
            },
            {
              path: '/security_center',
              component: SecurityCenter
            },
            {
              path: '/publish_business',
              component: PublishBusiness
            },
            {
              path: '/problem_feedback',
              component: ProblemFeedback
            },
          ]
        },
      ]
    },
    {
      path: '/order/detail_buyer',
      name: 'orderDetailBuyer',
      component: OrderDetailBuyer
    },
    {
      path: '/order/detail_seller',
      name: 'orderDetailSeller',
      component: OrderDetailSeller
    },
    {
      path: '/publish/sell',
      name: 'PublishSell',
      component: PublishSell
    },
    {
      path: '/publish/buy',
      name: 'PublishBuy',
      component: PublishBuy
    },
    {
      path: '/security_center',
      name: 'SecurityCenter',
      component: SecurityCenter
    },
    {
      path: '/exchange/gst',
      name: 'ExchangeGst',
      component: ExchangeGst,
    },
    {
      path: '/exchange/candy',
      name: 'ExchangeCandy',
      component: ExchangeCandy
    },
    {
      path: '/exchange/record',
      name: 'ExchangeRecord',
      component: ExchangeRecord
    },
    {
      path: '/exchange/candy/record',
      name: 'ExchangeCandyRecord',
      component: ExchangeCandyRecord
    },
    {
      path: '/publish_business',
      name: 'PublishBusiness',
      component: PublishBusiness
    },
    {
      path: '/problem_feedback',
      name: 'ProblemFeedback',
      component: ProblemFeedback
    },
    {
      path: '/feedback',
      name: 'Feedback',
      component: Feedback
    },
    {
      path: '/feedback/history',
      name: 'FeedbackHistory',
      component: FeedbackHistory
    },
    {
      path: '/feedback/detail',
      name: 'FeedbackDetail',
      component: FeedbackDetail
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/business/detail',
      name: 'BusinessDetail',
      component: BusinessDetail
    },
  ]
})
